package ch.bfh.abcm.rems.controller.model;

import ch.bfh.abcm.rems.gateway.GateWayMessageType;

public class TreshholdManager {

    Treshhold periodicTreshhold = null;
    Treshhold syserrorTreshhold = null;
    Treshhold mesdivTreshhold = null;
    
    @SuppressWarnings("incomplete-switch")
    public void addTH(Treshhold treshhold, GateWayMessageType gateWayMessageType){
        switch (gateWayMessageType) {
        case SYSTEM_ERROR:
            syserrorTreshhold = treshhold;
            break;
        case MEASUREMENT_DIVERGENCE:
            mesdivTreshhold = treshhold;
            break;
        case  PERIODIC_NOTIFICATION:
            periodicTreshhold = treshhold;
            break;
        }
    }
    
    public Treshhold getTreshHold(GateWayMessageType gateWayMessageType){
        switch (gateWayMessageType) {
        case SYSTEM_ERROR:
            return syserrorTreshhold;
        case MEASUREMENT_DIVERGENCE:
            return mesdivTreshhold;
        case  PERIODIC_NOTIFICATION:
            return periodicTreshhold;
        default:
            return null;
        }
        
    }
}
